package com.srwl.mytx.utils;

import android.content.Context;

import com.srwl.mytx.Constant;
import com.srwl.mytx.R;
import com.srwl.mytx.domain.Message;

public class ChatMessageUtil {
    public static String getMessageDigest(Message message) {
        String digest = "";
        switch (message.getSubType()) {
            case Constant.IM_TYPE_TEXT:
                digest = message.getContent();
                break;
            case Constant.IM_TYPE_IMAGE:
                digest = "[图片]";
                break;
            case Constant.IM_TYPE_AUDIO:
                digest = "[语音]";
                break;
            case Constant.IM_TYPE_VIDEO:
                digest = "[视频]";
                break;
            case Constant.IM_TYPE_GEO:
                digest = "[位置]";
                break;
            case Constant.IM_TYPE_COUPON:
                digest = "[红包]";
                break;
            case Constant.IM_TYPE_TRANSFER:
                digest = "[转账]";
                break;
        }
        return digest;
    }

    static String getString(Context context, int resId) {
        return context.getResources().getString(resId);
    }

}
